<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<script type="text/javascript" src="../js/functions.js"></script>
<script type="application/javascript" src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<script type="application/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
<script type="text/javascript" src="../js/validation.js"></script>
<script type="text/javascript" src="../inc/bootstrap/js/bootstrap.js"></script>
<script type="application/javascript" src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>	
<!-- ==== MODAL SCRIPTS ==== -->
<? include ('modals.php') ?>
<script type="text/javascript"><!--
// Create
$(".create-link").click(function(){
	$.get(this.href, function(data){
		$(".modal-body").html($(data).find("form.createForm"));
	})
	$(".Mcreate").modal({ show: true });
	return false;
});

// Read	
$(".detail-link").click(function(){
	$.get(this.href, function(data){
		$(".modal-body").html($(data).find("div.details"));
	})
	$(".Mdetails").modal({ show: true });
	return false;
});

// Update	
$(".edit-link").click(function(){
	$.get(this.href, function(data){
		$(".modal-body").html($(data).find("form.editForm"));
	})
	$(".Medit").modal({ show: true });
	return false;
});
	
// Delete
$(".delete-link").click(function(){
	$.get(this.href, function(data){
		$(".modal-body").html($(data).find("div.delete"));
	})
	$(".Mdelete").modal({ show: true });
	return false;
});

// Form Post
	$("form.formPost").submit(function(e) {
		var postData = $(this).serialize();
		$.post(this.action, postData + '&ajax=true', function(data) {
			if($(data).find("control-group").length > 0) {
				$(".success").modal()
			}else{
				$(data).alert("Process Failed");
			}
		});
		return false;
	});

--></script> 